//
//  NewSiteViewController.m
//  WGFGlobalHouse
//
//  Created by waiguofang on 15/4/15.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//  新盘

#import "NewSiteViewController.h"
#import "DetailHouseTypeViewController.h"
#import "MapViewController.h"
#import "SiteIntroduceViewController.h"
#import "SellingpointCell.h"
#import "Connect.h"
#import "JSONKit.h"




#define  SCROLLHEIGHT 1797

@interface NewSiteViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (strong, nonatomic) IBOutlet UIScrollView *mainView;

//楼盘名称
@property (weak, nonatomic) IBOutlet UILabel *siteNameLab;
//开盘时间
@property (weak, nonatomic) IBOutlet UILabel *openSiteLab;
//楼盘的位置
@property (weak, nonatomic) IBOutlet UILabel *siteLocationLab;
//美金
@property (weak, nonatomic) IBOutlet UILabel *dollarLab;
//人民币
@property (weak, nonatomic) IBOutlet UILabel *renMinBiLab;
//写着“最高佣金”字样的lab
@property (weak, nonatomic) IBOutlet UILabel *moenyTxt;
//竖分割线
@property (weak, nonatomic) IBOutlet UIView *Hview;
//显示最高佣金
@property (weak, nonatomic) IBOutlet UILabel *pointLab;
//天
@property (weak, nonatomic) IBOutlet UILabel *dayLab;
//小时
@property (weak, nonatomic) IBOutlet UILabel *hourLab;
//分钟
@property (weak, nonatomic) IBOutlet UILabel *minuteLab;
//秒
@property (weak, nonatomic) IBOutlet UILabel *secondLab;


//房屋面积
@property (weak, nonatomic) IBOutlet UILabel *areaLab;
//总套数
@property (weak, nonatomic) IBOutlet UILabel *totalNumLab;
//已售数
@property (weak, nonatomic) IBOutlet UILabel *soldNum;
//包租
@property (weak, nonatomic) IBOutlet UILabel *rentLab;
//回购
@property (weak, nonatomic) IBOutlet UILabel *buyBackLab;
//租金收入
@property (weak, nonatomic) IBOutlet UILabel *rentMoneyLab;


//盘的进度条
@property (weak, nonatomic) IBOutlet UIImageView * progressImage;

//买家优惠
@property (weak, nonatomic) IBOutlet UILabel *buyersdiscountLab;
//佣金结算1
@property (weak, nonatomic) IBOutlet UILabel *moneyAccountLab1;
//佣金结算2
@property (weak, nonatomic) IBOutlet UILabel *moneyAccountLab2;


//社区设施
@property (weak, nonatomic) IBOutlet UILabel *sheQuServiceLab;
//周边配套
@property (weak, nonatomic) IBOutlet UILabel *aroundServiceLab;
//休闲设施
@property (weak, nonatomic) IBOutlet UILabel *freeServiceLab;
//健康健身
@property (weak, nonatomic) IBOutlet UILabel *bodyBuildServiceLab;
//汽电设施
@property (weak, nonatomic) IBOutlet UILabel *powerServiceLab;
//房源配套设施
@property (weak, nonatomic) IBOutlet UILabel *peiTaoServiceLab;


//详情介绍
@property (weak, nonatomic) IBOutlet UITextView *detailedLab;

//推广
@property (weak, nonatomic) IBOutlet UILabel *extendLab;
//活动
@property (weak, nonatomic) IBOutlet UILabel *activityLab;

//地图位置
@property (strong ,nonatomic)NSNumber *latitude;
@property (strong ,nonatomic)NSNumber *longitude;


@property (weak, nonatomic) IBOutlet UIView *mapView;
@property (strong, nonatomic) NSMutableArray *arrayM;


/**
 * 点击带“>”剪头的view
 */
- (IBAction)tapViewWithShearHead:(UIView *)sender;
/**
 *  点击下载按钮
 */
- (IBAction)clickDownLoadBtn:(UIButton *)sender;


@end

@implementation NewSiteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.titleView setMianTitle:@"新盘"];
    self.mainView.contentSize = CGSizeMake(MAIN_SCREEN_bounds.size.width, SCROLLHEIGHT);

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

//-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//{
//    return 6;
//}
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
//{
//    if (section == 3)
//        return 3;
//    else
//        return 1;
//}

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    return [SellingpointCell cellWithTableView:tableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark 创建地图－－－还缺少具体的地址
-(void)createMap
{
//    MapViewController *vc = [[MapViewController alloc] init];
//    vc.latitude = self.latitude;
//    vc.longitude = self.longitude;
////    vc.address = _lm.title;
//    vc.view.userInteractionEnabled = NO;
//    vc.view.center = self.mapView.center;
//    [self.mapView addSubview:vc.view];
}

/**
 *  点击带">”剪头的view
 */
- (IBAction)tapViewWithShearHead:(UIView *)sender {
    
    NSInteger tag = sender.tag;
    if (tag == 100)
    {
        //点击买家优惠view
        NSLog(@"点击买家优惠");
        
    }else if (tag == 101)
    {
        //点击佣金结算
        NSLog(@"点击佣金结算");
    }
    else if (tag == 102)
    {
        
       
        //详情介绍
        SiteIntroduceViewController *vc = [[SiteIntroduceViewController alloc]initWithNibName:@"SiteIntroduceViewController" bundle:nil];
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (tag == 103)
    {
        
       
        //查看房型
        DetailHouseTypeViewController  *vc = [[DetailHouseTypeViewController alloc]initWithNibName:@"DetailHouseTypeViewController" bundle:nil];
        [self.navigationController pushViewController:vc animated:YES];
       
    }else
    {
        //查看楼盘地理位置
        MapViewController *vc = [[MapViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
    }
}

/**
 *  点击下载按钮
 */
- (IBAction)clickDownLoadBtn:(UIButton *)sender {
    NSInteger tag = sender.tag;
    if (tag == 200)
    {//经纪人下载
        NSLog(@"经纪人下载专区");
    }else
    {
        //客户下载
        NSLog(@"客户下载");
    }
}
@end
